window.onload = () => {
    let username = document.getElementById('username')
    console.log(username.value)
    //监听输入事件
    username.addEventListener('input', (e) => {
        console.log('有输入了:', e.target.value)
    })

    let sexMale = document.getElementById('male')
    sexMale.checked = true
    //监听复选框选择状态事件
    sexMale.addEventListener("change", (e) => {
        console.log("复选框有变动")
        console.log(sexMale.checked)
    })

    let sexFemale = document.getElementById('female')
    sexMale.checked = false
    sexMale.addEventListener("change", (e) => {
        console.log("复选框有变动")
        console.log(sexMale.checked)
    })

    let city = document.querySelector("city")
    city.addEventListener("changr", (e) => {
        console.log("下拉框有变动")
        console.log(e.target.value)


    })
}